projects
/
gtk4.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
07a3fb8
)
textlayout: Don't call render_para too much
author
Matthias Clasen
<mclasen@redhat.com>
Sun, 4 Apr 2021 02:02:45 +0000
(22:02 -0400)
committer
Matthias Clasen
<mclasen@redhat.com>
Sun, 4 Apr 2021 18:20:25 +0000
(14:20 -0400)
render_para produces no nodes for an empty paragraph.
Don't call it over and over for those.
gtk/gtktextlayout.c
patch
|
blob
|
history
diff --git
a/gtk/gtktextlayout.c
b/gtk/gtktextlayout.c
index ae6ed3bb311284002113861a9d099d55f92f75e9..4ab2b5cd4dea400583d1cd9045d5af266f95737b 100644
(file)
--- a/
gtk/gtktextlayout.c
+++ b/
gtk/gtktextlayout.c
@@
-4245,7
+4245,9
@@
gtk_text_layout_snapshot (GtkTextLayout *layout,
g_clear_pointer (&line_display->node, gsk_render_node_unref);
}
- if (line_display->node == NULL)
+ if (line_display->node == NULL &&
+ (pango_layout_get_character_count (line_display->layout) > 0 ||
+ selection_start_index != -1 || selection_end_index != -1))
{
gtk_snapshot_push_collect (snapshot);
render_para (crenderer, line_display,